﻿<!DOCTYPE html>
<html>
  <head>
    <title>goodsDetail_left.html</title>
    <meta name="content-type" content="text/html; charset=UTF-8">
  </head>
  
  <script type="text/javascript">
  	var gcgId = $("#gcgId").val();
    $(function() {
    	//1.
    	$.ajax({
    		cache: false,
			url:"page/goods/relateCategory?gcgId=" + gcgId,
			type: "GET",
			data: new Date().getTime(),
			dataType:"json",
		    success: function(data) {
		    	var length = data.length;
		    	if (length != 0) {
					if (length == 1) {
						$("#cate_one").empty();
						$("#cate_one").append("<li><a href='goods/goodsFilter?rtype="+data[0].gcId+"&gcgId=15' target='_blank'>" + data[0].categoryName + "</a></li>");
					} else {
				    	var qian = length%2 == 0 ? length/2 : (length - 1)/2;
				    	var cate_one = "";
				    	var cate_two = "";
						for (var i = 0; i<qian; i++) {
							cate_one += "<li><a href='goods/goodsFilter?rtype="+data[i].gcId+"&gcgId=15' target='_blank'>" + data[i].categoryName + "</a></li>";
						}
						for (var i = qian; i<length; i++) {
							cate_two += "<li><a href='goods/goodsFilter?rtype="+data[i].gcId+"&gcgId=15' target='_blank'>" + data[i].categoryName + "</a></li>";
						}
						$("#cate_one").empty();
						$("#cate_two").empty();
						$("#cate_one").append(cate_one);
						$("#cate_two").append(cate_two);
					}  		
		    	}
		    }
    	});
    	
    	//2.
    	$.ajax({
    		cache: false,
			url:"page/goods/detailLeft?gcgId=" + gcgId,
			type: "GET",
			data: new Date().getTime(),
			dataType:"json",
		    success: function(data) {
		    	var list = data.detailOneList;
		    	var html = "";
		    	if (list.length != 0) {
		    		for (var i = 0; i<list.length; i++) {
		    			html += "<div class='common_main_ad'>"
				    		+ "<div class='img'><a href='goods/goodsDetail?id="+list[i].goodsNum+"'><img src='"+list[i].mainpic+"'></a></div>"
				    		+ "<div class='content'><a href='goods/goodsDetail?id="+list[i].goodsNum+"'>"+list[i].goodsName+"</a></div>"
				    		+ "<div class='price'>￥"+list[i].goodsPrice+"</div>"
				    		+ "</div>";
		    		}
		    		$("#choose_main").empty();
		    		$("#choose_main").append(html);
		    	}
		    }
    	});
    	
    	//3.
    	$.ajax({
    		cache: false,
			url:"page/goods/detailLeft?gcgId=" + gcgId,
			type: "GET",
			data: new Date().getTime(),
			dataType:"json",
		    success: function(data) {
		    	var list = data.detailTwoList;
		    	var html = "";
		    	if (list.length != 0) {
		    		for (var i = 0; i<list.length; i++) {
		    			html += "<div class='common_main_ad'>"
				    		+ "<div class='img'><a href='goods/goodsDetail?id="+list[i].goodsNum+"'><img src='"+list[i].mainpic+"'></a></div>"
				    		+ "<div class='content'><a href='goods/goodsDetail?id="+list[i].goodsNum+"'>"+list[i].goodsName+"</a></div>"
				    		+ "<div class='price'>￥"+list[i].goodsPrice+"</div>"
				    		+ "</div>";
		    		}
		    		$("#lookmore_main").empty();
		    		$("#lookmore_main").append(html);
		    	}
		    }
    	});
    });
    </script>
    
    <!--主内容左部分开始-->
    <div class="anything">
        <div class="anything_wrap">
            <div class="anything_wrap_xiangguan">
                <div class="xiangguan_title">相关分类</div>
                <div class="xiangguan_main">
                    <ul style="margin-left: 2%;" id="cate_one">
                        <li><a href="JavaScript:void(0);">暂无</a></li>
                    </ul>
                    <ul id="cate_two">
                        <li><a href="JavaScript:void(0);">暂无</a></li>
                    </ul>
                </div>
            </div>
            <div class="anything_wrap_choose">
                <div class="choose_title">达人选购</div>
                <div class="choose_main" id="choose_main">
                    <div class="common_main_ad">
                        <div class="img"><a href="#"><img src="images/img_05.jpg"></a>  </div>
                        <div class="content"><a href="#">趣玩创意&nbsp;智能遥控器&nbsp;白色创意礼品&nbsp;生日生日礼品</a> </div>
                        <div class="price">￥68.00</div>
                    </div>
                    <!-- <div class="common_main_ad">
                        <div class="img"><a href="#"><img src="images/img_05.jpg"></a>  </div>
                        <div class="content"><a href="#">趣玩创意&nbsp;智能遥控器&nbsp;白色创意礼品&nbsp;生日生日礼品</a> </div>
                        <div class="price">￥68.00</div>
                    </div>
                    <div class="common_main_ad">
                        <div class="img"><a href="#"><img src="images/img_05.jpg"></a>  </div>
                        <div class="content"><a href="#">趣玩创意&nbsp;智能遥控器&nbsp;白色创意礼品&nbsp;生日生日礼品</a> </div>
                        <div class="price">￥68.00</div>
                    </div>
                    <div class="common_main_ad">
                        <div class="img"><a href="#"><img src="images/img_05.jpg"></a>  </div>
                        <div class="content"><a href="#">趣玩创意&nbsp;智能遥控器&nbsp;白色创意礼品&nbsp;生日生日礼品</a> </div>
                        <div class="price">￥68.00</div>
                    </div>
                    <div class="common_main_ad">
                        <div class="img"><a href="#"><img src="images/img_05.jpg"></a>  </div>
                        <div class="content"><a href="#">趣玩创意&nbsp;智能遥控器&nbsp;白色创意礼品&nbsp;生日生日礼品</a> </div>
                        <div class="price">￥68.00</div>
                    </div>
                    <div class="common_main_ad">
                        <div class="img"><a href="#"><img src="images/img_05.jpg"></a>  </div>
                        <div class="content"><a href="#">趣玩创意&nbsp;智能遥控器&nbsp;白色创意礼品&nbsp;生日生日礼品</a> </div>
                        <div class="price">￥68.00</div>
                    </div> -->
                </div>
            </div>
            <div class="anything_wrap_lookmore">
                <div class="lookmore_title">看了又看</div>
                <div class="lookmore_main" id="lookmore_main">
                    <!-- <div class="common_main_ad">
                        <div class="img"><a href="#"><img src="images/img_05.jpg"></a>  </div>
                        <div class="content"><a href="#">趣玩创意&nbsp;智能遥控器&nbsp;白色创意礼品&nbsp;生日生日礼品</a> </div>
                        <div class="price">￥68.00</div>
                    </div>
                    <div class="common_main_ad">
                        <div class="img"><a href="#"><img src="images/img_05.jpg"></a>  </div>
                        <div class="content"><a href="#">趣玩创意&nbsp;智能遥控器&nbsp;白色创意礼品&nbsp;生日生日礼品</a> </div>
                        <div class="price">￥68.00</div>
                    </div>
                    <div class="common_main_ad">
                        <div class="img"><a href="#"><img src="images/img_05.jpg"></a>  </div>
                        <div class="content"><a href="#">趣玩创意&nbsp;智能遥控器&nbsp;白色创意礼品&nbsp;生日生日礼品</a> </div>
                        <div class="price">￥68.00</div>
                    </div>
                    <div class="common_main_ad">
                        <div class="img"><a href="#"><img src="images/img_05.jpg"></a>  </div>
                        <div class="content"><a href="#">趣玩创意&nbsp;智能遥控器&nbsp;白色创意礼品&nbsp;生日生日礼品</a> </div>
                        <div class="price">￥68.00</div>
                    </div>
                    <div class="common_main_ad">
                        <div class="img"><a href="#"><img src="images/img_05.jpg"></a>  </div>
                        <div class="content"><a href="#">趣玩创意&nbsp;智能遥控器&nbsp;白色创意礼品&nbsp;生日生日礼品</a> </div>
                        <div class="price">￥68.00</div>
                    </div>
                    <div class="common_main_ad">
                        <div class="img"><a href="#"><img src="images/img_05.jpg"></a>  </div>
                        <div class="content"><a href="#">趣玩创意&nbsp;智能遥控器&nbsp;白色创意礼品&nbsp;生日生日礼品</a> </div>
                        <div class="price">￥68.00</div>
                    </div> -->
                </div>
            </div>
        </div>
    </div>
</html>
